﻿using IQIGame.Onigao.GamePlay;
using IQIGame.Onigao.GamePlay.Editors;
using UnityEditor;

namespace IQIGame.Onigao.Game.Editors
{
    [CustomEditor(typeof(TimelineManager))]
    public class TimelineManagerInspector : UnityEditor.Editor
    {
        public override void OnInspectorGUI()
        {
            var rTarget = this.target as TimelineManager;
            bool bDirty = false;
            bDirty |= BattleEditorTools.EnumPopup(typeof(EntityPoolGroupType), "Timeline特效Entity组类型", ref rTarget.timelineEffectGroupID);
            bDirty |= BattleEditorTools.FloatField("Instance自动释放间隔", ref rTarget.InstanceAutoReleaseInterval);
            bDirty |= BattleEditorTools.FloatField("Instance过期时间", ref rTarget.InstanceExpireTime);
            bDirty |= BattleEditorTools.IntField("同预设资源实例容量", ref rTarget.SameResInstanceCapacity);
            bDirty |= BattleEditorTools.IntField("资源实例总容量", ref rTarget.TotalInstanceCapacity);
            if (bDirty)
            {
                EditorUtility.SetDirty(rTarget);
                this.serializedObject.ApplyModifiedProperties();
            }
        }
    }
}